$(function () {

    // transform();

    //根据资质类型查资质名称
    $('#qualificationForm [name="certificateType"]').on("change", function () {
        findCertificateName("190px", "#qualificationForm [name=certificateType]", "#qualificationForm [name='certificateName']", "ZZ_CREDENTIAL");
    });
});

function checkAptitudeSpecialty(obj) {
    var certificateSpecialtys = getVal(obj, 1);
    if (!checkIsEmpty(certificateSpecialtys) && certificateSpecialtys.length > 5) {
        DGG.Errors("最多只能选择五个资质名称！");
        return false;
    } else {
        return true;
    }
}


//金额格式化转化
function transform() {
    var nStr = $("#qualificationForm [name='receiptPrice']").val().replace(/,/g, '');
    if (nStr != null && nStr != "") {
        nStr = parseInt(nStr);
    }
    $("[name='receiptPrice']").val(formatNumber(nStr));
}

function formatNumber(str) {
    str = str.toString().substr(0, 8);
    if (str.length <= 3) {
        return str;
    } else {
        return formatNumber(str.substr(0, str.length - 3)) + ',' + str.substr(str.length - 3);
    }
}
